import Vue from 'vue'
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'

import 'normalize.css/normalize.css' ;

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' ;

import '@/styles/index.scss' ;

import App from './App'
import store from './store'
import router from './router/index'

import '@/icons' ;


if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

Vue.use(ElementUI, { locale })
Vue.config.productionTip = false

import Directives from "./directive/index.js"
Vue.use(Directives)

new Vue({
  el: '#app',
  router,
  store,
  mavonEditor,
  data: {
    Bus: new Vue()
  },
  render: h => h(App),
  beforeCreate() {
    this.$store.dispatch('initializeStore');
  }
})
